<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>Docs For Class ClusterModel</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
			<div class="page-body">			
<h2 class="class-name"><img src="../media/images/Class_logo.png"
														alt=" Class"
														title=" Class"
														style="vertical-align: middle"> ClusterModel</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
													<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
						|											<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
						
					</div>
	<div class="info-box-body">
        		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">The cluster enabled model-class</p>
<p class="description"><p>give it an array of connection-names for database-masters (those are used to alter data)  and an array of connection names for slaves (those are used to read data) and it  automatically cycles between them if one fails. master and slave may overlap, the  same connection is used then.</p></p>
	<ul class="tags">
				<li><span class="field">author:</span> mnt@codeninja.de</li>
			</ul>
		<p class="notes">
			Located in <a class="field" href="_kata---lib---clustermodel.php.html">/kata/lib/clustermodel.php</a> (line <span class="field">27</span>)
		</p>
		
				
		<pre><a href="../kata_model/Model.html">Model</a>
   |
   --ClusterModel</pre>
	
			</div>
</div>



	<a name="sec-var-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Variable Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
						<span class="disabled">Vars</span> (<a href="#sec-vars">details</a>)
							| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
								</div>
		<div class="info-box-body">
			<div class="var-summary">
																																																																<div class="var-title">
					<img src="../media/images/Variable.png" alt=" " />
					<span class="var-type">boolean</span>
					<a href="#$allowFailover" title="details" class="var-name">$allowFailover</a>
				</div>
																<div class="var-title">
					<img src="../media/images/Variable.png" alt=" " />
					<span class="var-type">boolean</span>
					<a href="#$cacheQueries" title="details" class="var-name">$cacheQueries</a>
				</div>
																<div class="var-title">
					<img src="../media/images/Variable.png" alt=" " />
					<span class="var-type">array</span>
					<a href="#$masters" title="details" class="var-name">$masters</a>
				</div>
																<div class="var-title">
					<img src="../media/images/Variable.png" alt=" " />
					<span class="var-type">boolean</span>
					<a href="#$randomSlave" title="details" class="var-name">$randomSlave</a>
				</div>
																<div class="var-title">
					<img src="../media/images/Variable.png" alt=" " />
					<span class="var-type">boolean</span>
					<a href="#$readFromMasterAfterWrite" title="details" class="var-name">$readFromMasterAfterWrite</a>
				</div>
																<div class="var-title">
					<img src="../media/images/Variable.png" alt=" " />
					<span class="var-type">array</span>
					<a href="#$slaves" title="details" class="var-name">$slaves</a>
				</div>
											</div>
		</div>
	</div>

	<a name="sec-method-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Method Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
																		<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
				 
				|
						<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
		</div>
		<div class="info-box-body">			
			<div class="method-summary">
																																<div class="method-definition">
					<img src="../media/images/Constructor.png" alt=" "/>
											<span class="method-result">ClusterModel</span>
										<a href="#__construct" title="details" class="method-name">__construct</a>
										()
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">void</span>
										<a href="#query" title="details" class="method-name">query</a>
											(<span class="var-type"></span>&nbsp;<span class="var-name">$s</span>, [<span class="var-type"></span>&nbsp;<span class="var-name">$idname</span> = <span class="var-default">null</span>])
									</div>
											</div>
		</div>
	</div>		

	<a name="sec-vars"></a>
	<div class="info-box">
		<div class="info-box-title">Variables</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
										<a href="#sec-var-summary">Vars</a> (<span class="disabled">details</span>)
						
			
										| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
					</div>
		<div class="info-box-body">
			
<a name="var$allowFailover" id="$allowFailover"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<img src="../media/images/Variable.png" />
		<span class="var-title">
			<span class="var-type">boolean</span>
			<span class="var-name">$allowFailover</span>
			 = <span class="var-default"> true</span>			(line <span class="line-number">54</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">var:</span> allow model to connect to next master/slave if connection fails</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	
		
		

</div>
<a name="var$cacheQueries" id="$cacheQueries"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<img src="../media/images/Variable.png" />
		<span class="var-title">
			<span class="var-type">boolean</span>
			<span class="var-name">$cacheQueries</span>
			 = <span class="var-default"> false</span>			(line <span class="line-number">69</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">var:</span> should we cache writes ourself so we dont have read from masters?</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	
		
		

</div>
<a name="var$masters" id="$masters"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<img src="../media/images/Variable.png" />
		<span class="var-title">
			<span class="var-type">array</span>
			<span class="var-name">$masters</span>
			 = <span class="var-default"> null</span>			(line <span class="line-number">40</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">var:</span> array of connection names of database-masters to use for writes</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	
		
		

</div>
<a name="var$randomSlave" id="$randomSlave"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<img src="../media/images/Variable.png" />
		<span class="var-title">
			<span class="var-type">boolean</span>
			<span class="var-name">$randomSlave</span>
			 = <span class="var-default"> false</span>			(line <span class="line-number">49</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">var:</span> connect to a random slave on startup?</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	
		
		

</div>
<a name="var$readFromMasterAfterWrite" id="$readFromMasterAfterWrite"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<img src="../media/images/Variable.png" />
		<span class="var-title">
			<span class="var-type">boolean</span>
			<span class="var-name">$readFromMasterAfterWrite</span>
			 = <span class="var-default"> true</span>			(line <span class="line-number">59</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">var:</span> switch reads to master after we altered db, so we dont read stale data because of replication-lag</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	
		
		

</div>
<a name="var$slaves" id="$slaves"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<img src="../media/images/Variable.png" />
		<span class="var-title">
			<span class="var-type">array</span>
			<span class="var-name">$slaves</span>
			 = <span class="var-default"> null</span>			(line <span class="line-number">31</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">var:</span> array of connection names of database-slaves to use for reads</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	
		
		

</div>
							<h4>Inherited Variables</h4>
				<A NAME='inherited_vars'><!-- --></A>
									<p>Inherited from <span class="classname"><a href="../kata_model/Model.html">Model</a></span></p>
					<blockquote>
													<img src="../media/images/Variable.png" />
							<span class="var-title">
								<span class="var-name"><a href="../kata_model/Model.html#var$connection">Model::$connection</a></span><br>
							</span>
													<img src="../media/images/Variable.png" />
							<span class="var-title">
								<span class="var-name"><a href="../kata_model/Model.html#var$dboClass">Model::$dboClass</a></span><br>
							</span>
													<img src="../media/images/Variable.png" />
							<span class="var-title">
								<span class="var-name"><a href="../kata_model/Model.html#var$useIndex">Model::$useIndex</a></span><br>
							</span>
													<img src="../media/images/Variable.png" />
							<span class="var-title">
								<span class="var-name"><a href="../kata_model/Model.html#var$useTable">Model::$useTable</a></span><br>
							</span>
											</blockquote> 
										
		</div>
	</div>
	
	<a name="sec-methods"></a>
	<div class="info-box">
		<div class="info-box-title">Methods</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
															<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
														<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
						
		</div>
		<div class="info-box-body">
			<A NAME='method_detail'></A>
<a name="method__construct" id="__construct"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../media/images/Constructor.png" />
		<span class="method-title">Constructor __construct</span> (line <span class="line-number">76</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">ClusterModel</span>
		<span class="method-name">
			__construct
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodquery" id="query"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">query</span> (line <span class="line-number">82</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			query
		</span>
					(<span class="var-type"></span>&nbsp;<span class="var-name">$s</span>, [<span class="var-type"></span>&nbsp;<span class="var-name">$idname</span> = <span class="var-default">null</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type"></span>
				<span class="var-name">$s</span>			</li>
					<li>
				<span class="var-type"></span>
				<span class="var-name">$idname</span>			</li>
				</ul>
		
			<hr class="separator" />
		<div class="notes">Redefinition of:</div>
		<dl>
			<dt><a href="../kata_model/Model.html#methodquery">Model::query()</a></dt>
						<dd>execute an actual query on the database</dd>
					</dl>
			
	</div>
							<h4>Inherited Methods</h4>
				<a name='inherited_methods'><!-- --></a>	
									<!-- =========== Summary =========== -->
					<p>Inherited From <span class="classname"><a href="../kata_model/Model.html">Model</a></span></p>
					<blockquote>
													<img src="../media/images/Method.png" alt=" "/>
							<span class="method-name"><a href="../kata_model/Model.html#methodbulkcreate">Model::bulkcreate()</a></span><br>
													<img src="../media/images/Method.png" alt=" "/>
							<span class="method-name"><a href="../kata_model/Model.html#methodcachedQuery">Model::cachedQuery()</a></span><br>
													<img src="../media/images/Method.png" alt=" "/>
							<span class="method-name"><a href="../kata_model/Model.html#methodchangeConnection">Model::changeConnection()</a></span><br>
													<img src="../media/images/Method.png" alt=" "/>
							<span class="method-name"><a href="../kata_model/Model.html#methodcreate">Model::create()</a></span><br>
													<img src="../media/images/Method.png" alt=" "/>
							<span class="method-name"><a href="../kata_model/Model.html#methoddbo">Model::dbo()</a></span><br>
													<img src="../media/images/Method.png" alt=" "/>
							<span class="method-name"><a href="../kata_model/Model.html#methoddelete">Model::delete()</a></span><br>
													<img src="../media/images/Method.png" alt=" "/>
							<span class="method-name"><a href="../kata_model/Model.html#methoddescribe">Model::describe()</a></span><br>
													<img src="../media/images/Method.png" alt=" "/>
							<span class="method-name"><a href="../kata_model/Model.html#methodescape">Model::escape()</a></span><br>
													<img src="../media/images/Method.png" alt=" "/>
							<span class="method-name"><a href="../kata_model/Model.html#methodfind">Model::find()</a></span><br>
													<img src="../media/images/Method.png" alt=" "/>
							<span class="method-name"><a href="../kata_model/Model.html#methodgetConfig">Model::getConfig()</a></span><br>
													<img src="../media/images/Method.png" alt=" "/>
							<span class="method-name"><a href="../kata_model/Model.html#methodgetConnectionName">Model::getConnectionName()</a></span><br>
													<img src="../media/images/Method.png" alt=" "/>
							<span class="method-name"><a href="../kata_model/Model.html#methodgetLink">Model::getLink()</a></span><br>
													<img src="../media/images/Method.png" alt=" "/>
							<span class="method-name"><a href="../kata_model/Model.html#methodgetModel">Model::getModel()</a></span><br>
													<img src="../media/images/Method.png" alt=" "/>
							<span class="method-name"><a href="../kata_model/Model.html#methodgetPrefix">Model::getPrefix()</a></span><br>
													<img src="../media/images/Method.png" alt=" "/>
							<span class="method-name"><a href="../kata_model/Model.html#methodgetTableName">Model::getTableName()</a></span><br>
													<img src="../media/images/Method.png" alt=" "/>
							<span class="method-name"><a href="../kata_model/Model.html#methodgetWhereString">Model::getWhereString()</a></span><br>
													<img src="../media/images/Method.png" alt=" "/>
							<span class="method-name"><a href="../kata_model/Model.html#methodlog">Model::log()</a></span><br>
													<img src="../media/images/Method.png" alt=" "/>
							<span class="method-name"><a href="../kata_model/Model.html#methodmakeDateTime">Model::makeDateTime()</a></span><br>
													<img src="../media/images/Method.png" alt=" "/>
							<span class="method-name"><a href="../kata_model/Model.html#methodpairs">Model::pairs()</a></span><br>
													<img src="../media/images/Method.png" alt=" "/>
							<span class="method-name"><a href="../kata_model/Model.html#methodquery">Model::query()</a></span><br>
													<img src="../media/images/Method.png" alt=" "/>
							<span class="method-name"><a href="../kata_model/Model.html#methodquote">Model::quote()</a></span><br>
													<img src="../media/images/Method.png" alt=" "/>
							<span class="method-name"><a href="../kata_model/Model.html#methodquoteName">Model::quoteName()</a></span><br>
													<img src="../media/images/Method.png" alt=" "/>
							<span class="method-name"><a href="../kata_model/Model.html#methodread">Model::read()</a></span><br>
													<img src="../media/images/Method.png" alt=" "/>
							<span class="method-name"><a href="../kata_model/Model.html#methodreplace">Model::replace()</a></span><br>
													<img src="../media/images/Method.png" alt=" "/>
							<span class="method-name"><a href="../kata_model/Model.html#methodsetupDbo">Model::setupDbo()</a></span><br>
													<img src="../media/images/Method.png" alt=" "/>
							<span class="method-name"><a href="../kata_model/Model.html#methodupdate">Model::update()</a></span><br>
													<img src="../media/images/Method.png" alt=" "/>
							<span class="method-name"><a href="../kata_model/Model.html#methodvalidate">Model::validate()</a></span><br>
											</blockquote>
										
		</div>
	</div>

	
	<p class="notes" id="credit">
		Documentation generated on Thu, 23 Sep 2010 16:25:52 +0200 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.1</a>
	</p>
	</div></body>
</html>